{extend name="base" /} {block name="body"}

<!--tab标签-->
<div class="layui-tab-brief">

    <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
            <form class="layui-form form-container" data-url="{:url('feelym/articlecate/update')}" localtion-url="{:url('articlecate/index')}">
                <div class="layui-form-item">
                    <label class="layui-form-label">排序</label>
                    <div class="layui-input-inline">
                        <input type="text" name="sort" placeholder="仅限整数" autocomplete="off" class="layui-input" value="{$tptc.sort}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">栏目名称</label>
                    <div class="layui-input-inline">
                        <input type="text" name="name" value="{$tptc.name}" required lay-verify="required" placeholder="必填内容" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item" style="width: 300px;">
                    <label class="layui-form-label">所属栏目</label>
                    <div class="layui-input-block">
                        <select name="tid">
                  <option value="0">顶级栏目</option>
                  {volist name="$category_level_list" id="vo"}
                  <option value="{$vo.id}" {if condition="$tptc['id'] eq $vo['id']" }disabled="" {/if}{if condition="$tptc['tid'] eq $vo['id']"
                    }selected="selected" {/if}>{neq name="vo.level" value="1"}|{php}for($i=1;$i
                    <$vo[ 'level'];$i++){echo ' --';}{/php}{/neq}{$vo.name}</option>
                      {/volist}
                </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">别名</label>
                    <div class="layui-input-inline">
                        <input type="text" name="alias" value="{$tptc.alias}" required lay-verify="required" placeholder="必填内容，英文" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">图标</label>
                    <div class="layui-input-inline">
                        <input type="text" name="icon" value="{$tptc.icon}" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">标题背景</label>
                    <div class="layui-input-inline">
                        <input type="text" name="background" value="{$tptc.background}" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">内容模板</label>
                    <div class="layui-input-inline">
                        <select name="template">
                                    <option value="article" {if $tptc.template eq 'article'}selected="selected"{/if}>文章模板</option>
                                    <option value="soft" {if $tptc.template eq 'soft'}selected="selected"{/if}>软件模板</option>
                                    <option value="page" {if $tptc.template eq 'page'}selected="selected"{/if}>单页模板</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">列表页模板</label>
                    <div class="layui-input-inline">
                        <select name="list_template">
                                    <option value="articlelist" {if $tptc.template eq 'articlelist'}selected="selected"{/if}>文章列表模板</option>
                                    <option value="softlist" {if $tptc.template eq 'softlist'}selected="selected"{/if}>软件列表模板</option>
                                    <option value="pagelist" {if $tptc.template eq 'pagelist'}selected="selected"{/if}>单页列表模板</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">关键词</label>
                    <div class="layui-input-block">
                        <input type="text" name="keywords" value="{$tptc.keywords}" placeholder="请输入内容" autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">描述</label>
                    <div class="layui-input-block">
                        <textarea name="description" placeholder="请输入内容" class="layui-textarea">{$tptc.description}</textarea>
                    </div>
                </div>
                <input type="hidden" name="id" value="{$tptc.id}">
                <div class="btable-paged">
                    <div class="layui-main">
                        <div class="formbtngroup">
                            <button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="formadd">更新</button>
                            <button onclick="history.go(-1);return false;" class="layui-btn layui-btn-primary layui-btn-sm">返回</button>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

{/block} {block name="js"}
<script type="text/javascript" src="__ADMIN__/js/formadd.js"></script> {/block} {block name="script"}
<script>
    layui.use(['form', 'upload'], function() {
        var form = layui.form,
            upload = layui.upload,
            jq = layui.jquery;
        upload.render({
            elem: '#image',
            url: '{:url("upload/upimage")}',
            before: function(obj) {
                obj.preview(function(index, file, result) {
                    jq('#picshow').attr('src', result); //图片链接（base64）
                });
            },
            done: function(res) {
                if (res.code == '200') {
                    jq('input[name=pic]').val(res.path);
                    return layer.msg('上传成功');
                } else {
                    return layer.msg(res.msg);
                }

            }
        });
    })
</script> {/block}